<?php
namespace api\know\controller;

use api\wxapp\controller\PublicController;
use api\know\model\MaterialModel;
use api\know\model\TeachingMaterialContentModel;
use api\know\model\ResourceModel;
use api\know\model\TeachingMaterialKnowledgePointModel;
use api\know\model\TeachingMaterialNewWordModel;
use api\know\model\KnowledgePointModel;
use api\know\model\NewWordModel;

use think\facade\Log;

class KnowleadgePointController extends PublicController
{
    public function detail()
    {
        $kp_uuid = $this->request->param('uuid', '');
		if (empty($kp_uuid))
        {
            $this->error('知识点不能为空!');
        }

        $kp_wh[] = ['is_delete', '=', 0];
        $kp_wh[] = ['is_enable', '=', 1];
        $kp_wh[] = ['uuid', '=', $kp_uuid];

        $kp = KnowledgePointModel::where($kp_wh)->field(KnowledgePointModel::$QueryField)->find();
        $kp['analysis'] = htmlspecialchars_decode(htmlspecialchars_decode($kp['analysis']));
        
        $this->success('请求成功!', [
            'content' => $kp,
            'question' => [],
            'questionExam' => [],
        ]);
    }

}
